package com.ruoyi.order.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.OrderComplaintMapper;
import com.ruoyi.order.domain.OrderComplaint;
import com.ruoyi.order.service.IOrderComplaintService;

/**
 * 订单投诉Service业务层处理
 * 
 * @author DEREK
 * @date 2023-06-28
 */
@Service
public class OrderComplaintServiceImpl extends ServiceImpl<OrderComplaintMapper, OrderComplaint> implements IOrderComplaintService 
{
    @Autowired
    private OrderComplaintMapper orderComplaintMapper;

    /**
     * 查询订单投诉
     * 
     * @param id 订单投诉主键
     * @return 订单投诉
     */
    @Override
    public OrderComplaint selectOrderComplaintById(Long id)
    {
        return orderComplaintMapper.selectOrderComplaintById(id);
    }

    /**
     * 查询订单投诉列表
     * 
     * @param orderComplaint 订单投诉
     * @return 订单投诉
     */
    @Override
    public List<OrderComplaint> selectOrderComplaintList(OrderComplaint orderComplaint)
    {
        return orderComplaintMapper.selectOrderComplaintList(orderComplaint);
    }

    /**
     * 新增订单投诉
     * 
     * @param orderComplaint 订单投诉
     * @return 结果
     */
    @Override
    public int insertOrderComplaint(OrderComplaint orderComplaint)
    {
        orderComplaint.setCreateTime(DateUtils.getNowDate());
        return orderComplaintMapper.insertOrderComplaint(orderComplaint);
    }

    /**
     * 修改订单投诉
     * 
     * @param orderComplaint 订单投诉
     * @return 结果
     */
    @Override
    public int updateOrderComplaint(OrderComplaint orderComplaint)
    {
        //orderComplaint.setUpdateTime(DateUtils.getNowDate());
        return orderComplaintMapper.updateOrderComplaint(orderComplaint);
    }

    /**
     * 批量删除订单投诉
     * 
     * @param ids 需要删除的订单投诉主键
     * @return 结果
     */
    @Override
    public int deleteOrderComplaintByIds(Long[] ids)
    {
        return orderComplaintMapper.deleteOrderComplaintByIds(ids);
    }

    /**
     * 删除订单投诉信息
     * 
     * @param id 订单投诉主键
     * @return 结果
     */
    @Override
    public int deleteOrderComplaintById(Long id)
    {
        return orderComplaintMapper.deleteOrderComplaintById(id);
    }
}
